package com.study.lxy.springcloud.brac_ia.service.impl;

import com.alibaba.fastjson.JSON;
import com.study.lxy.springcloud.brac_ia.entity.ClientUser;
import com.study.lxy.springcloud.brac_ia.service.LoginService;
import com.study.lxy.springcloud.brac_ia.serviceClient.UclientClient;
import com.study.lxy.springcloud.common.format.RespParse;
import com.study.lxy.springcloud.common.format.ServiceResp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class LoginServiceImpl implements LoginService {
    private static final Logger logger = LoggerFactory.getLogger(LoginServiceImpl.class);
    @Autowired
    UclientClient uclientClient;
    @Override
    public void doLogin(ClientUser clientUser) {
        logger.info("start login,user = {}",clientUser);
        ServiceResp resp = uclientClient.Login(clientUser);
        logger.info("response is : {}", JSON.toJSONString(resp));
        RespParse.parseDummy(resp);
    }
}
